<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <ul class="nav nav-tabs" style="margin-bottom: 10px;">
        <li role="presentation" class="active"><a data-toggle="tab" href="#base">基础设置</a></li>
        <li role="presentation"><a data-toggle="tab" href="#price">价格设置</a></li>
        <li role="presentation"><a data-toggle="tab" href="#attrs">规格属性</a></li>
        <li role="presentation"><a data-toggle="tab" href="#dispatch">运费设置</a></li>
        <li role="presentation"><a data-toggle="tab" href="#detail">详情设置</a></li>

    </ul>

    <div class="tab-content">
        <!--        商品信息-->
        <div class="active tab-pane" id="base">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Cate_id')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-cate_id" data-rule="required" data-source="category/selectpagetree" data-field="diyname" data-format-item="{name}" class="form-control selectpage" name="row[cate_id]" type="text" value="">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Goods_sn')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-goods_sn" class="form-control" name="row[goods_sn]" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Goods_name')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-goods_name" data-rule="required" class="form-control" name="row[goods_name]" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-desc" data-rule="required" class="form-control" name="row[desc]" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Brand')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-brand" class="form-control" name="row[brand]" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Keywords')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-keywords" data-rule="required" class="form-control " data-role="tagsinput" name="row[keywords]"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="input-group">
                        <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text">
                        <div class="input-group-addon no-border no-padding">
                            <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                            <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                        </div>
                        <span class="msg-box n-right" for="c-image"></span>
                    </div>
                    <ul class="row list-inline faupload-preview" id="p-image"></ul>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="input-group">
                        <input id="c-images" data-rule="required" class="form-control" size="50" name="row[images]" type="text">
                        <div class="input-group-addon no-border no-padding">
                            <span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                            <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                        </div>
                        <span class="msg-box n-right" for="c-images"></span>
                    </div>
                    <ul class="row list-inline faupload-preview" id="p-images"></ul>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="50">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Is_index')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input  id="c-is_index" name="row[is_index]" type="hidden" value="0">
                    <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-confirm="确认切换开关？" data-input-id="c-is_index" data-yes="1" data-no="0" >
                        <i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>
                    </a>
                </div>
            </div>
<!--            <div class="form-group exchange_coupon_id hide">-->
<!--                <label class="control-label col-xs-12 col-sm-2">{:__('Coupon_exchange_id')}:</label>-->
<!--                <div class="col-xs-12 col-sm-8">-->
<!--                    <input id="c-coupon_exchange_id" data-source="coupon_exchange/selectpage" data-field="title" class="form-control selectpage" name="row[coupon_exchange_id]" type="text" value="">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <div class="radio">
                        {foreach name="statusList" item="vo"}
                        <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="up"}checked{/in} /> {$vo}</label>
                        {/foreach}
                    </div>

                </div>
            </div>
        </div>

        <!--        价格设置-->
        <div class="tab-pane" id="price">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-price" data-rule="required" min="0" class="form-control" step="0.01" name="row[price]" type="number" value="0.00">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Original_price')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-original_price" data-rule="required" min="0" class="form-control" step="0.01" name="row[original_price]" type="number" value="0.00">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Limit_num')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-limit_num" data-rule="required" class="form-control" name="row[limit_num]" type="number" value="1">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Show_sales')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-show_sales" class="form-control" name="row[show_sales]" type="number">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Stock_type')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <div class="radio">
                        {foreach name="stockTypeList" item="vo"}
                        <label for="row[stock_type]-{$key}"><input id="row[stock_type]-{$key}" name="row[stock_type]" type="radio" value="{$key}" {in name="key" value="place"}checked{/in} /> {$vo}</label>
                        {/foreach}
                    </div>

                </div>
            </div>
        </div>

        <!--        规格设置-->
        <div class="tab-pane" id="attrs">
            <div id="goods_spec_table2" class="goods-sku-table" style="overflow-x: auto;"> <!--ajax 返回 规格对应的库存--> </div>
        </div>

        <!--        运费设置-->
        <div class="tab-pane" id="dispatch">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Dispatch_type')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <div class="radio">
                        {foreach name="dispatchTypeList" item="vo"}
                        <label for="row[dispatch_type]-{$key}"><input id="row[dispatch_type]-{$key}" name="row[dispatch_type]" type="checkbox" value="{$key}" checked /> {$vo}</label>
                        {/foreach}
                    </div>

                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Dispatch_ids')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-dispatch_ids" data-rule="required" data-source="delivery/delivery/index" data-multiple="false" class="form-control selectpage" name="row[dispatch_ids]" type="text" value="">
                </div>
            </div>
        </div>

        <!--        详情设置-->
        <div class="tab-pane" id="detail">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Service_ids')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-service_ids" data-rule="required" data-source="goods/goods_service/index" data-multiple="true" class="form-control selectpage" name="row[service_ids]" type="text" value="">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Params')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <table class="table table-responsive fieldlist" data-name="row[params]" data-template="params" data-tag="tr">
                        <tr>
                            <td>键名</td>
                            <td>键值</td>
                            <td></td>
                        </tr>
                        <tr>
                            <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a></td>
                        </tr>
                        <textarea name="row[params]" class="form-control hide" cols="30" rows="5"></textarea>
                    </table>
                    <!--定义模板，模板语法使用Art-Template模板语法-->
                    <script type="text/html" id="params">
                        <tr class="form-inline">
                            <td><input type="text" name="row[<%=name%>][<%=index%>][title]" class="form-control" value="<%=row['title']%>" size="10"></td>
                            <td><input type="text" name="row[<%=name%>][<%=index%>][content]" class="form-control" value="<%=row['content']%>" size="30"></td>
                            <td><span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span></td>
                        </tr>
                    </script>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
                </div>
            </div>
        </div>
    </div>


<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Likes')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-likes" data-rule="required" class="form-control" name="row[likes]" type="number" value="0">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Views')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-views" data-rule="required" class="form-control" name="row[views]" type="number" value="0">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Sales')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-sales" data-rule="required" class="form-control" name="row[sales]" type="number" value="0">-->
<!--        </div>-->
<!--    </div>-->

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
